package com.junjie.checkin.controller;

import com.junjie.checkin.request.pointRecord.PointRecordAdminPageRequest;
import com.junjie.checkin.request.pointRecord.PointRecordPageRequest;
import com.junjie.checkin.response.PageResult;
import com.junjie.checkin.response.Result;
import com.junjie.checkin.response.ResultStatus;
import com.junjie.checkin.response.admin.DisciplinaryRecordsResponse;
import com.junjie.checkin.response.front.ActivityFrontResponse;
import com.junjie.checkin.response.pointRecord.PointRecordResponse;
import com.junjie.checkin.service.PointRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/pointRecord")
public class AdminPointRecordController {
    @Autowired
    private PointRecordService pointRecordService;

    /**
     * 获取积分记录
     * @param request
     * @return
     */
    @GetMapping("")
    public Result<PageResult<DisciplinaryRecordsResponse>> getPointRecordPage(PointRecordAdminPageRequest request){
        request.initDefault();
        PageResult<DisciplinaryRecordsResponse> pageResult = pointRecordService.getPointRecordPage(request);
        return Result.getResult(ResultStatus.OK,pageResult);
    }
}
